<?php
// tests/unit/AllUnitTests.php
/**
 * demo-zf application
 *
 * AllUnitTests
 *
 * Test suite script for all unit tests
 *
 * @author Adam Pilacki <adam.pilacki@gmail.com>
 */

set_include_path(
    get_include_path() . PATH_SEPARATOR .
    'vendor'
);

/* Define path to application directory */
define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../../application'));

/* Define application environment */
define('APPLICATION_ENV', 'testing');

/* set error reporting */
error_reporting(E_ALL | E_STRICT);

/* Set the time zone for Poland */
date_default_timezone_set('Europe/Warsaw');

//error_reporting(E_ALL | E_STRICT);
require_once 'Zend/Loader/Autoloader.php';
Zend_Loader_Autoloader::getInstance()->registerNamespace('AdamP_');

if (!Zend_Loader::isReadable('PHPUnit/Framework/TestSuite.php')) {
    echo 'Class PHPUnit_Framework_TestSuite cannot be found - You have to set proper include path' . PHP_EOL;
    echo 'Tests cannot be performed...';
    exit(404);
}

/* include needed helper class */
require_once 'UnitTestsHelper.php';

/* include test cases */
require_once 'application/modules/default/controllers/IndexControllerTest.php';
require_once 'application/modules/default/controllers/UserControllerTest.php';

final class AllTests
    extends PHPUnit_Framework_TestSuite
{
    public static final function suite()
    {
        /* @var $suite PHPUnit_Framework_TestSuite */
        $suite = new PHPUnit_Framework_TestSuite('AllTestsSuite');
        $suite->addTestSuite('IndexControllerTest');
        $suite->addTestSuite('UserControllerTest');
        return $suite;
    }
}